﻿@model IEnumerable<SeguriGasesERP.Models.Venta>

@{
    ViewBag.Title = "Reporte de Ventas por Factura";
}

<h2>Reporte de Ventas por Factura</h2>

<h3> Total sin iva = @ViewBag.Total</h3>
<h3> Total con iva = @ViewBag.TotalIva</h3>
<div id="filtros">
@using (Html.BeginForm())
{
        <table>
            <tr> 
                <td>Seleccionar rango de fechas:</td>
                <td>
                    
                </td>
            </tr>
            <tr>
                <td>
                    
                    @Html.DropDownList("mes1", new SelectList(ViewBag.Meses as  System.Collections.IEnumerable, "Value", "Text"))
                    @Html.DropDownList("anio1", new SelectList(ViewBag.Anios as System.Collections.IEnumerable, "Value", "Text"))
                </td>
                <td>
                    
                    @Html.DropDownList("mes2", new SelectList(ViewBag.Meses as  System.Collections.IEnumerable, "Value", "Text"))
                    @Html.DropDownList("anio2", new SelectList(ViewBag.Anios as System.Collections.IEnumerable, "Value", "Text"))
                </td>
                <td>
                    <input type="submit" value="Buscar" />
                    
                    
                </td>
            </tr>
        </table>
    <br />
}
</div>
<table>
    <tr>
        <th>
            Folio
        </th>        
        <th>
            Fecha de Venta
        </th>
        <th>
            Liquidado
        </th>
        <th>
            Sucursal
        </th>
        <th>
            Cliente
        </th>
        <th>
            Realizada por
        </th>
        <th>
            Total
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.ClaveCFD)
        </td>
        
        
     
        <td>
            @Html.DisplayFor(modelItem => item.FechaVenta)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Liquidado)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Sucursal.Nombre)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Cliente.NombreCliente)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.usuario)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Total)
        </td>
        <td>
            @Html.ActionLink("Detalles", "../Ventas/Details",   new { id=item.ID })
            
           
        </td>
    </tr>
}

</table>
